package com.halden.mycache.core.Impl;

import lombok.Data;
import lombok.Value;

import java.util.Date;

/**
 * @Author: halden
 * @Data:2023/2/3 10:32
 * @Description: 对value的包装类
 * @since 0.0.1
 */
@Data
public class CacheValue<T> {
    private T value;
    private long lastUseTime;
    private long expireTime;
    private double visitFrequency = 0;

    public CacheValue (T value){
        this.value = value;
        this.lastUseTime = new Date().getTime();
        this.expireTime = -1l;
    }
    public CacheValue (){}
}
